import request from '@/utils/request'

// 查询认领记录列表
export function listRecord(query) {
  return request({
    url: '/found/record/list',
    method: 'get',
    params: query
  })
}

// 查询认领记录详细
export function getRecord(claimId) {
  return request({
    url: '/found/record/' + claimId,
    method: 'get'
  })
}


// 查询招领全部姓名
export function getAllEduRecordRecruitments() {
  return request({
    url: '/found/record/getAllEduRecordRecruitments',
    method: 'get'
  })
}


// 新增认领记录
export function addRecord(data) {
  return request({
    url: '/found/record',
    method: 'post',
    data: data
  })
}

// 修改认领记录
export function updateRecord(data) {
  return request({
    url: '/found/record',
    method: 'put',
    data: data
  })
}

// 删除认领记录
export function delRecord(claimId) {
  return request({
    url: '/found/record/' + claimId,
    method: 'delete'
  })
}

// 提交申请
export function submitClaimAll(claimId) {
  return request({
    url: '/found/record/submitClaim/' + claimId,
    method: 'get'
  })
}


// 查询未认领记录列表
export function listNoClaimAll(query) {
  return request({
    url: '/found/record/listNo',
    method: 'get',
    params: query
  })
}


// 查询未完成的审批
export function getNoRecordOther(claimId) {
  return request({
    url: '/found/record/getNoRecordOther/' + claimId,
    method: 'get'
  })
}

// 审批认领记录
export function approveNoRecord(data) {
  return request({
    url: '/found/record/approveNoRecord',
    method: 'post',
    data: data
  })
}

// 查询完成认领记录列表
export function listFinished(query) {
  return request({
    url: '/found/record/listFinished',
    method: 'get',
    params: query
  })
}

// 查询认领的详细和历史批注
export function getCommerntEduClaimRecord(claimId) {
  return request({
    url: '/found/record/getEduClaimRecordComment/' + claimId,
    method: 'get'
  })
}